﻿<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <!--[if lt IE 9]>
       <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
       <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
     <![endif]-->
    <title>最佳女王瑜伽培训中心</title>
    <link href="/styles/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <Script type="text/javascript">
 window.location.href = "/mobile/index";
   </script>
    <style>
        @-webkit-keyframes spin {
            0% {
                -webkit-transform: rotate(0deg);
                transform: rotate(0deg);
            }

            100% {
                -webkit-transform: rotate(360deg);
                transform: rotate(360deg);
            }
        }

        @keyframes spin {
            0% {
                -webkit-transform: rotate(0deg);
                transform: rotate(0deg);
            }

            100% {
                -webkit-transform: rotate(360deg);
                transform: rotate(360deg);
            }
        }

        .page-loading {
            width: 100%;
            height: 100%;
            background-color: #fff;
            position: fixed;
            top: 0;
            left: 0;
            z-index: 1;
            overflow: hidden;
        }

        .loader {
            border: 4px solid #ddd;
            -webkit-animation: spin 1s linear infinite;
            animation: spin 1s linear infinite;
            border-top: 4px solid #000;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            top: 50%;
            left: 50%;
            position: absolute;
            margin: -25px 0 0 -25px;
        }


        .navbar-default {
            background-color: #000000;
            border-color: #e7e7e7;
            padding: 15px 0px;
            margin-bottom: 0px;
        }

            .navbar-default .navbar-nav > li {
                padding: 0px 0px;
            }

                .navbar-default .navbar-nav > li > a {
                    color: #5f1a00;
                    font-size: 16px;
                }

                    .navbar-default .navbar-nav > li > a:hover {
                        color: #f18a05;
                        text-decoration: underline;
                    }

            .navbar-default .navbar-nav > .active > a,
            .navbar-default .navbar-nav > .active > a:hover,
            .navbar-default .navbar-nav > .active > a:focus {
                color: #f18a05;
                text-decoration: none;
            }

            .navbar-default .navbar-brand {
                color: #fff;
                float: left;
                height: 50px;
                padding: 15px 15px;
                font-size: 35px;
                line-height: 20px;
                padding-right: 100px;
            }

                .navbar-default .navbar-brand:hover {
                    cursor: pointer;
                    color: #82381d;
                }

        .navbar-static-top {
            z-index: 1000;
            border-width: 0 0 0px;
        }

        .blockquote {
            padding: 10px 20px;
            margin: 0 0 20px;
            font-size: 15.5px;
            border-left: 5px solid #eee;
        }

        .navbar-default .navbar-brand {
            color: #82381d;
            float: left;
            height: 50px;
            padding: 5px 15px;
            font-size: 35px;
            line-height: 30px;
            padding-right: 100px;
        }

        .dropdown-menu {
            border-top: 1px;
        }

            .dropdown-menu > li > a {
                display: block;
                padding: 10px 10px;
                clear: both;
                font-weight: 400;
                line-height: 1.42857143;
                color: #6b2005;
                white-space: nowrap;
            }

                .dropdown-menu > li > a:hover {
                    background-color: #eee;
                }

        .input-group-addon {
            padding: 6px 12px;
            font-size: 14px;
            font-weight: 400;
            line-height: 1;
            color: #FFF;
            text-align: center;
            background-color: #5CB85C;
            border: 1px solid #9C9C9C;
            border-radius: 4px;
        }

        #extendPage {
            background-color: #fff;
        }

        #extendPage_html {
            border: 0px solid #eee;
            border-radius: 0px;
            padding: 0px;
            background-color: #fff;
            margin-top: 0px;
            padding-top: 0px;
            min-height: 600px;
        }

        .footer {
            border-top: 0px solid #e5e5e5;
            text-align: center;
            padding-top: 30px;
            padding-bottom: 30px;
            background-color: #f3f3f3;
            margin-top: 30px;
        }

            .footer span {
                color: #666;
                line-height: 30px;
                font-size: 15px;
                font-family: 'SimSun';
            }

        #bodyPage {
            min-height: 600px;
        }


        .navbar-default {
            background-color: #ffffff;
            border-color: #e7e7e7;
            padding: 15px 0px;
            margin-bottom: 0px;
        }

            .navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:focus, .navbar-default .navbar-nav > .active > a:hover {
                color: #ff9000;
                background-color: rgba(255, 255, 255, 0);
            }

        .footer-css {
            border-top: 1px solid #ddd;
            color: #fff;
            background: #000;
        }

        .topTag {
            max-height: 300px;
            overflow: hidden;
            background-color: #fff;
            display: none;
        }
    </style>

    <script src="/js/lib/jquery.js"></script>
    <script>
        window.location.href = "/mobile/index";
        if ($(window).width() < 600) {
            window.location.href = "/mobile/index";
        }
    </script>

   
    <script src="/js/lib/bootstrap.js"></script>   
</head>
<body>
    <div class="page-loading">
        <div class="loader"></div>
    </div>

    <nav class="navbar navbar-default navbar-shiguang navbar-static-top" data-nav="#abouts" style="padding: 0px;">
        <div class="container-fluid" style="padding:15px;">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" aria-expanded="false" data-target=".navbar-collapse">
                    <span class="sr-only">导航</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <!-- <a class="navbar-brand" href="/home"><img src="images/logo.png" class="img-responsive center-block"  /></a> -->
                <a class="navbar-brand" href="/home" style="line-height: 40px;">最佳女王瑜伽</a>
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav navbar-respond"></ul>
                <ul class="nav navbar-nav navbar-left">
                    <li id="nav1" class="nav"><a href="/">网站首页</a></li>
                    <li id="nav2" class="nav"><a href="/product">训练照片展示</a></li>
                    <li id="nav3" class="nav"><a href="/news">新闻动态</a></li>
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    <div style="padding-top:15px;padding-right:10px;">
                        <button id="wechart" class="btn btn-success btn-sm">
                            <span class="glyphicon glyphicon-heart"></span> 关注微信
                        </button>
                    </div>
                </ul>
            </div>
        </div>
    </nav>
    <div class="topTag">

    </div>
    <div id="bodyPage">        
        <%-body -%>
    </div>
    <div id="extendPage" style="display: none;" class="container">
        <div id="extendPage_html">
        </div>
    </div>

    <div class="footer footer-css" id="footer">
        <div class="container">
            <div class="row">
                <span>联系电话：18611171241 | 微信号：：18611171241</span>
                <br />
                <span>京ICP备17032479号 | 最佳女王瑜伽培训中心 © 版权所有</span>
            </div>
            <div class="row">
            </div>
        </div>

    </div>

    <div>

        <div style="width:100px ;bottom:50px; position:fixed; right: 10px;z-index: 999;">
            <button class="btn btn-success" id="leaveMsg"><span class="glyphicon glyphicon-envelope" style="font-size:13px;"></span>&nbsp;在线留言</button>
        </div>

        <div style="width:100px ;bottom:10px; position:fixed; right: 10px;z-index: 999;">
            <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=1213382796&site=qq&menu=yes"><img border="0" src="http://wpa.qq.com/pa?p=2:2496464296:41" alt="在线咨询" title="在线咨询" style="width:100px" /></a>
        </div>

        <div class="modal fade bs-example-modal-md" id="weixinModal" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
            <div class="modal-dialog modal-md">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" style="color:#888;"><span class="glyphicon glyphicon-heart" style="font-size:13px;"></span>&nbsp;关注微信</h4>
                    </div>
                    <div class="modal-body">
                        <div>
                            <img src="images/weixin.jpg" class="img-responsive  center-block" />
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- Modal  leave massage -->
        <div class="modal fade" id="massageModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" style="color:#888;"><span class="glyphicon glyphicon-envelope" style="font-size:13px;"></span>&nbsp;在线留言</h4>
                    </div>
                    <div class="modal-body">
                        <div class="form-group">
                            <label>如何称呼您</label>
                            <input type="text" class="form-control" id="name" placeholder="必填项" name="name">
                        </div>
                        <div class="form-group">
                            <label>您的电话</label>
                            <input type="text" class="form-control" id="telephone" placeholder="必填" name="telephone">
                        </div>
                        <div class="form-group">
                            <label>您的微信号码</label>
                            <input type="text" class="form-control" id="weixinNo" placeholder="" name="weixin">
                        </div>
                        <div class="form-group">
                            <label>您的留言内容</label>
                            <textarea class="form-control" rows="4" id="connectMsg" name="leaveMsg" placeholder="必填项"></textarea>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-success" id="msgSaveBtn">提交</button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    

    <script type="text/javascript">
        function getSiteBg() {           
            var Jsondata = {};
            Jsondata.type = "PC背景图片";
            Jsondata.pageIndex = 1;
            Jsondata.pageSize = 100;
            $.post("/admin/getnewsListByType", JSON.stringify(Jsondata), function (response) {
                var url = window.location.href;
                $(".nav").removeClass("active");
                var bgimg_product = "default.jpg";
                var newsDetail_product = "default.jpg";
                var news_product = "default.jpg";
                for (i = 0; i < response.length; i++) {
                    var o=response[i];
                    if (o.title == "产品背景") bgimg_product = o.newImg;
                    if (o.title == "新闻动态背景") news_product = o.newImg;
                    if (o.title == "详情页背景") newsDetail_product = o.newImg;
                }
                if (url.indexOf("/product") > 0) {
                    $("#nav2").addClass("active");
                    $(".topTag").html("<img src='../files/upload/" + bgimg_product + "' style='width:100%;border:0px;'/>");
                    $(".topTag").fadeIn(2000);
                    return;
                }
                if (url.indexOf("/newsDetail") > 0) {
                    $("#nav3").addClass("active");
                    $(".topTag").html("<img src='../files/upload/" + newsDetail_product + "' style='width:100%;border:0px;'/>");
                    $(".topTag").fadeIn(2000);
                    return;
                }

                if (url.indexOf("/news") > 0) {
                    $("#nav3").addClass("active");
                    $(".topTag").html("<img src='../files/upload/" + news_product + "' style='width:100%;border:0px;'/>");
                    $(".topTag").fadeIn(2000);
                    return;
                }
                $("#nav1").addClass("active");
            });
        }
        var navItem = [];
        function getNavItem() {
            var indexHtml = "";
            var Jsondata = {};
            Jsondata.type = "网站菜单";
            Jsondata.pageIndex = 1;
            Jsondata.pageSize = 100;
            $.post("/admin/getnewsListByType", JSON.stringify(Jsondata), function (response) {
                navItem = response;
                var maxItem = 10;
                var myNav = "";
                var moreNav = "";
                var smallScreen = "";
                for (i = 0; i < navItem.length; i++) {
                    navItem[i].navIndex = i;
                    var navid = "expend_" + i.toString();
                    var tempNav = "<li id='" + navid + "' class='nav {{class}}' ><a href='##' onclick='setNavItem(" + i.toString() + "," + navItem[i].IsUrl + ")'>" + navItem[i].title + "</a></li>";
                    if (i < maxItem) {
                        var temp = tempNav;
                        myNav += temp.replace("{{class}}", "hidden-xs hidden-sm");
                        var temp2 = tempNav;
                        smallScreen += temp2.replace("{{class}}", "");
                    }
                    else {
                        var temp3 = "<li id='" + navid + "' class='nav' ><a href='##' onclick='setNavItem(" + i.toString() + "," + navItem[i].IsUrl + ")'>" + navItem[i].title + "</a></li>";
                        moreNav += temp3;

                        smallScreen += temp3;
                    }

                }
                $("#SmallNav").html(smallScreen);

                $("#nav3").after(myNav);
                if (moreNav != "") {
                    $("#navItem").show();
                    $("#moreNav").html(moreNav);
                }
            });
        }

        function setNavItem(index, IsUrl) {
            var o;
            for (i = 0; i < navItem.length; i++) {
                if (i.toString() == index) {
                    o = navItem[i];
                }
            }
            if (o.Url != undefined && o.Url != null && o.Url != "") {
                window.open(o.Url);
                return;
            }
            $(".nav").removeClass("active");
            $("#expend_" + index).addClass("active");
            $("#bodyPage").hide();
            $("#extendPage").hide();
            $(".navbar-collapse").removeClass("in");

            $("#extendPage_html").html(o.content);
            $(".topTag").html("<img src='../files/upload/" + o.newImg + "' style='width:100%;border:0px;'/>");
            $(".topTag").slideDown(2000);
            $("#extendPage_html img").css("min-width", "100%");
            $("#extendPage").fadeIn("slow");
        }

        $(function () {
            getNavItem();
            getSiteBg();

            $("#wechart").click(function () {
                $('#weixinModal').modal({
                    keyboard: true
                })
            });


            $("#leaveMsg").click(function () {
                $('#massageModal').modal({
                    keyboard: true
                    , backdrop: "static"
                })
            });

            $("#msgSaveBtn").click(function () {
                if ($("#name").val() == "") { alert("您的称谓不能为空!"); return; }
                if ($("#telephone").val() == "") { alert("联系电话不能为空!"); return; }
                if ($("#connectMsg").val() == "") { alert("留言内容不能为空!"); return; }
                var JsonData = {
                    name: $("#name").val(),
                    telphone: $("#telephone").val(),
                    weixin: $("#weixinNo").val(),
                    leaveMsg: $("#connectMsg").val()
                };
                $.ajax({
                    url: '/admin/saveLeavemassage',
                    method: 'POST',
                    data: JSON.stringify(JsonData),
                    dataType: "json",
                    success: function (response) {
                        alert("留言提交成功!");
                        $('#massageModal').modal('hide');
                    }
                });
            });
            
        });



    </script>

</body>
</html>
